At the end of 2019, a novel coronavirus was identified as the cause of a cluster of pneumonia cases in China. It rapidly spread, resulting in an epidemic throughout the world. In February 2020, the World Health Organization designated the disease COVID-19, which stands for coronavirus disease 2019. This report is designed to explore the association beween Covid-19 death and state, age groups.
The data was obstained from the US CDC, Centers of Disease Control and Prevention. The date include deaths involving coronavirus disease 2019 (COVID-19), pneumonia, and influenza reported to NCHS by sex and age group and state.
We calculate the proportionate mortality ratio due to COVID-19 by using the COVID-19 deaths/total deaths.
library(data.table)
library(dtplyr)
library(dplyr)
library(leaflet)
library(tidyverse)
library(ggplot2)
covid = fread("data/Provisional_COVID-19_Death_Counts_by_Sex__Age__and_State.csv")
#calculate proportionate mortality ratio due to COVID-19
covid$PMR=covid$`COVID-19 Deaths`/covid$`Total Deaths`
Here, we create a map of proportionate mortality ratio among the states.
covid_state=covid[which(covid$Sex == "All Sexes" & covid$State != "United States" & covid$`Age group`=="All Ages"),]
#covid_state$State[which(covid_state$State %in% states$NAME ==F)]
covid_state[33,7:12]=covid_state[33,7:12]+covid_state[34,7:12]
covid_state=covid_state[-34, ]
covid_state$PMR=covid_state$`COVID-19 Deaths`/covid_state$`Total Deaths`
colnames(covid_state)[4]="NAME"
mergedata=merge(x = states, y = covid_state, by = "NAME", all.x = TRUE)
pal <- colorBin("YlOrRd", domain = mergedata$PMR)
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
setView(-98.483330, 38.712046, zoom = 4) %>%
addPolygons(
data=mergedata,
fillColor = ~pal(mergedata$PMR),
fillOpacity = 0.7,
weight = 0.2,
smoothFactor = 0.2
)%>%
addLegend(pal = pal,
values = mergedata$PMR,
position = "bottomright",
title = "PMR")
Here we can see that the New York State has the highest proportionate mortality ratio due to COVID-19. It means that New York City has the most people died because of Covid-19.
covid_2=covid[which(covid$Sex == "All Sexes" & covid$State == "United States" & covid$`Age group`!="All Ages"),]
covid_2=covid_2[which(covid_2$`Age group` == "Under 1 year" | covid$`Age group` == "1-4 years" | covid$`Age group` == "5-14 years" | covid$`Age group` == "15-24 years" | covid$`Age group` == "25-34 years" | covid$`Age group` == "35-44 years" | covid$`Age group` == "45-54 years" | covid$`Age group` == "55-64 years" | covid$`Age group` == "65-74 years" | covid$`Age group` == "75-84 years" | covid$`Age group` == "85 years and over")]
covid_2=na.omit(covid_2)
covid_3=subset(covid_2, select = c("Sex", "Age group","COVID-19 Deaths","Total Deaths","PMR"))
knitr::kable(covid_3)
| Sex | Age group | COVID-19 Deaths | Total Deaths | PMR |
|---|---|---|---|---|
| All Sexes | Under 1 year | 22 | 12092 | 0.0018194 |
| All Sexes | 5-14 years | 35 | 3597 | 0.0097303 |
| All Sexes | 15-24 years | 369 | 23153 | 0.0159375 |
| All Sexes | 18-29 years | 889 | 41027 | 0.0216687 |
| All Sexes | 30-49 years | 9181 | 142650 | 0.0643603 |
| All Sexes | 45-54 years | 10627 | 123171 | 0.0862784 |
| All Sexes | 50-64 years | 31899 | 355464 | 0.0897390 |
| All Sexes | 65-74 years | 42950 | 426332 | 0.1007431 |
| All Sexes | 75-84 years | 52618 | 519488 | 0.1012882 |
| All Sexes | 85 years and over | 61172 | 643778 | 0.0950203 |
From the map we can conlucde that the New York State has the highest proportionate mortality ratio due to COVID-19. We found that older people (greater than 65 years old) are easier die because of Covid-19.